package com.jzo2o.trade.controller;

import com.jzo2o.api.trade.dto.response.ExecutionResultResDTO;
import com.jzo2o.trade.service.IRefundService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * @Description:
 * @Version: V1.0
 */
@Slf4j
@RestController
@RequestMapping
public class RefundController {

    @Resource
    private IRefundService refundService;

    @PostMapping("inner/refund-record/refund")
    public ExecutionResultResDTO payV3(@RequestParam(name = "tradingOrderNo", required = true) Long tradingOrderNo,
                                       @RequestParam("refundAmount") BigDecimal refundAmount) {
        return refundService.refund(tradingOrderNo, refundAmount);
    }


}
